using System;
using System.Data;
using System.Collections.Generic;

namespace shfa.snomtastic.data.business
{
    public partial class AppConfigController
    {
		private AppConfigInfo ObjectFromDataRow(DataRow dr)
        {
            if (dr != null)
            {
				AppConfigInfo obj = new AppConfigInfo();
				obj.Id = dr.Field<Guid>("Id"); 
				obj.Name = (dr["Name"] != DBNull.Value) ? dr.Field<String>("Name") : string.Empty; 
				obj.Value = (dr["Value"] != DBNull.Value) ? dr.Field<String>("Value") : string.Empty; 
				return obj;
            }
            return null;
        }

        private List<AppConfigInfo> ListFromDataTable(DataTable dt)
        {
            List<AppConfigInfo> lst = new List<AppConfigInfo>();

            foreach (DataRow dr in dt.Rows)
            {
                lst.Add(ObjectFromDataRow(dr));
            }

            return lst;
        }
    }
}
